//
//  NotifyMute.swift
//  YueChat
//
//  Created by 1 on 2024/11/1.
//

import UIKit

class OsnNotifyNotifyMute: OsnNotifyContent {

    var groupId = ""
    var creator = ""
    var info = ""
    var type = ""
    var range = ""
    var userList:[String] = []

    override init(){
        super.init()
        contentType = OsnMessageContentType.notify_mute_group
    }
    override func toJson() ->[String:Any] {
        var json = super.toJson()
        json["type"] = "notify_mute_group"
        json["groupId"] = groupId
        json["info"] = info
        json["range"] = range
        json["userList"] = userList
        return json
    }
    static func fromJson(_ data:[String:Any])->OsnNotifyNotifyMute{
        let c = OsnNotifyNotifyMute()
        super.fromJson(c, data)
        c.groupId = data["groupId"] as? String ?? ""
        c.userList = data["userList"] as? [String] ?? []
        c.info = data["info"] as? String ?? ""
        c.range = data["range"] as? String ?? ""
        return c
    }
    
}
